<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>ActionDispatch::Http::Headers</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../css/github.css" type="text/css" media="screen" />
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>     
    <div class="banner">
        
            <span>Ruby on Rails v4.0.0</span><br />
        
        <h1>
            <span class="type">Class</span> 
            ActionDispatch::Http::Headers 
            
                <span class="parent">&lt; 
                    
                    <a href="../../Object.html">Object</a>
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../../files/actionpack/lib/action_dispatch/http/headers_rb.html">actionpack/lib/action_dispatch/http/headers.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
  


  


  
  


  


  
    <!-- Method ref -->
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
      
        <dt>#</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Headers.html#method-i-5B-5D">[]</a>,
              </li>
            
              
              <li>
                <a href="Headers.html#method-i-5B-5D-3D">[]=</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>E</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Headers.html#method-i-each">each</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>F</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Headers.html#method-i-fetch">fetch</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>I</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Headers.html#method-i-include-3F">include?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>K</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Headers.html#method-i-key-3F">key?</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>M</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Headers.html#method-i-merge">merge</a>,
              </li>
            
              
              <li>
                <a href="Headers.html#method-i-merge-21">merge!</a>
              </li>
            
          </ul>
        </dd>
      
        <dt>N</dt>
        <dd>
          <ul>
            
              
              <li>
                <a href="Headers.html#method-c-new">new</a>
              </li>
            
          </ul>
        </dd>
      
    </dl>
  

  
    <!-- Includes -->
    <div class="sectiontitle">Included Modules</div>
    <ul>
      
        <li>
          
            <a href="../../Enumerable.html">
              Enumerable
            </a>
          
        </li>
      
    </ul>
  



  

    

    

    
      <!-- Section constants -->
      <div class="sectiontitle">Constants</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class="attr-name">CGI_VARIABLES</td>
            <td>=</td>
            <td class="attr-value">%w(
CONTENT_TYPE CONTENT_LENGTH
HTTPS AUTH_TYPE GATEWAY_INTERFACE
PATH_INFO PATH_TRANSLATED QUERY_STRING
REMOTE_ADDR REMOTE_HOST REMOTE_IDENT REMOTE_USER
REQUEST_METHOD SCRIPT_NAME
SERVER_NAME SERVER_PORT SERVER_PROTOCOL SERVER_SOFTWARE
)</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
          <tr valign='top'>
            <td class="attr-name">HTTP_HEADER</td>
            <td>=</td>
            <td class="attr-value">/\A[A-Za-z0-9-]+\z/</td>
          </tr>
          
            <tr valign='top'>
              <td>&nbsp;</td>
              <td colspan="2" class="attr-desc"></td>
            </tr>
          
        
      </table>
    


    
      <!-- Section attributes -->
      <div class="sectiontitle">Attributes</div>
      <table border='0' cellpadding='5'>
        
          <tr valign='top'>
            <td class='attr-rw'>
              [R]
            </td>
            <td class='attr-name'>env</td>
            <td class='attr-desc'></td>
          </tr>
        
      </table>
    


    <!-- Methods -->
    
      <div class="sectiontitle">Class Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-c-new">
            
              <b>new</b>(env = {})
            
            <a href="Headers.html#method-c-new" name="method-c-new" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-c-new_source')" id="l_method-c-new_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/41a14dcd1045f61278237f34f065b87212689376/actionpack/lib/action_dispatch/http/headers.rb#L17" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-c-new_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/http/headers.rb, line 17</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">initialize</span>(<span class="ruby-identifier">env</span> = {})
  <span class="ruby-ivar">@env</span> = <span class="ruby-identifier">env</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                  
      <div class="sectiontitle">Instance Public methods</div>
      
        <div class="method">
          <div class="title method-title" id="method-i-5B-5D">
            
              <b>[]</b>(key)
            
            <a href="Headers.html#method-i-5B-5D" name="method-i-5B-5D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-5B-5D_source')" id="l_method-i-5B-5D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/41a14dcd1045f61278237f34f065b87212689376/actionpack/lib/action_dispatch/http/headers.rb#L21" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-5B-5D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/http/headers.rb, line 21</span>
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]</span>(<span class="ruby-keyword ruby-title">key</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-identifier">env_name</span>(<span class="ruby-identifier">key</span>)]
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-5B-5D-3D">
            
              <b>[]=</b>(key, value)
            
            <a href="Headers.html#method-i-5B-5D-3D" name="method-i-5B-5D-3D" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-5B-5D-3D_source')" id="l_method-i-5B-5D-3D_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/41a14dcd1045f61278237f34f065b87212689376/actionpack/lib/action_dispatch/http/headers.rb#L25" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-5B-5D-3D_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/http/headers.rb, line 25</span>
<span class="ruby-keyword">def</span> <span class="ruby-operator">[]=</span>(<span class="ruby-keyword ruby-title">key</span>, <span class="ruby-identifier">value</span>)
  <span class="ruby-ivar">@env</span>[<span class="ruby-identifier">env_name</span>(<span class="ruby-identifier">key</span>)] = <span class="ruby-identifier">value</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-each">
            
              <b>each</b>(&amp;block)
            
            <a href="Headers.html#method-i-each" name="method-i-each" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-each_source')" id="l_method-i-each_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/41a14dcd1045f61278237f34f065b87212689376/actionpack/lib/action_dispatch/http/headers.rb#L36" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-each_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/http/headers.rb, line 36</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">each</span>(&amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-ivar">@env</span>.<span class="ruby-identifier">each</span>(&amp;<span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-fetch">
            
              <b>fetch</b>(key, *args, &amp;block)
            
            <a href="Headers.html#method-i-fetch" name="method-i-fetch" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-fetch_source')" id="l_method-i-fetch_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/41a14dcd1045f61278237f34f065b87212689376/actionpack/lib/action_dispatch/http/headers.rb#L32" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-fetch_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/http/headers.rb, line 32</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">fetch</span>(<span class="ruby-identifier">key</span>, *<span class="ruby-identifier">args</span>, &amp;<span class="ruby-identifier">block</span>)
  <span class="ruby-ivar">@env</span>.<span class="ruby-identifier">fetch</span> <span class="ruby-identifier">env_name</span>(<span class="ruby-identifier">key</span>), *<span class="ruby-identifier">args</span>, &amp;<span class="ruby-identifier">block</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-include-3F">
            
              <b>include?</b>(key)
            
            <a href="Headers.html#method-i-include-3F" name="method-i-include-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-key-3F">
            
              <b>key?</b>(key)
            
            <a href="Headers.html#method-i-key-3F" name="method-i-key-3F" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
            <div class="aka">
              Also aliased as: <a href="Headers.html#method-i-include-3F">include?</a>
            </div>
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-key-3F_source')" id="l_method-i-key-3F_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/41a14dcd1045f61278237f34f065b87212689376/actionpack/lib/action_dispatch/http/headers.rb#L29" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-key-3F_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/http/headers.rb, line 29</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">key?</span>(<span class="ruby-identifier">key</span>); <span class="ruby-ivar">@env</span>.<span class="ruby-identifier">key?</span> <span class="ruby-identifier">key</span>; <span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-merge">
            
              <b>merge</b>(headers_or_env)
            
            <a href="Headers.html#method-i-merge" name="method-i-merge" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-merge_source')" id="l_method-i-merge_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/41a14dcd1045f61278237f34f065b87212689376/actionpack/lib/action_dispatch/http/headers.rb#L40" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-merge_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/http/headers.rb, line 40</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">merge</span>(<span class="ruby-identifier">headers_or_env</span>)
  <span class="ruby-identifier">headers</span> = <span class="ruby-constant">Http</span><span class="ruby-operator">::</span><span class="ruby-constant">Headers</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">env</span>.<span class="ruby-identifier">dup</span>)
  <span class="ruby-identifier">headers</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">headers_or_env</span>)
  <span class="ruby-identifier">headers</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
        
        <div class="method">
          <div class="title method-title" id="method-i-merge-21">
            
              <b>merge!</b>(headers_or_env)
            
            <a href="Headers.html#method-i-merge-21" name="method-i-merge-21" class="permalink">Link</a>
          </div>
          
          
            <div class="description">
              
            </div>
          
          
          
          
          
            
            <div class="sourcecode">
              
              <p class="source-link">
                Source: 
                <a href="javascript:toggleSource('method-i-merge-21_source')" id="l_method-i-merge-21_source">show</a>
                
                  | <a href="https://github.com/rails/rails/blob/41a14dcd1045f61278237f34f065b87212689376/actionpack/lib/action_dispatch/http/headers.rb#L46" target="_blank" class="github_url">on GitHub</a>
                
              </p>
              <div id="method-i-merge-21_source" class="dyn-source">
                <pre><span class="ruby-comment"># File actionpack/lib/action_dispatch/http/headers.rb, line 46</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">merge!</span>(<span class="ruby-identifier">headers_or_env</span>)
  <span class="ruby-identifier">headers_or_env</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">self</span>[<span class="ruby-identifier">env_name</span>(<span class="ruby-identifier">key</span>)] = <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
              </div>
            </div>
            
          </div>
                    </div>

    </div>
  </body>
</html>    